<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>批量加好友</title>
	
	<link rel="stylesheet" href="/layui/css/layui.css">
	<link rel="stylesheet" href="/hyqcss/public.css">
	<style type="text/css">
		body{
			background: #e9e9e9;
		}
		/*公共头部带搜索*/
		.public_container{
			margin: 20px;
			background: #fff;
		}
		.public_title_container{
			height: 54px;
			padding: 0 20px;
			font-size: 14px;
			display: flex;
			align-items: center;
			background: #f9f9f9;
			border-bottom: 1px solid #f0f0f0;
		}
		.public_buttonSearch_container{
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 20px;
			background: #fff;
		}
		.public_buttonSearch_container a{
			color: #fff;
			background-color: #1e9fff;
			text-shadow: 0 -1px 0 rgba(0,0,0,.12);
			height: 24px;
			padding: 4px 15px;
			font-size: 14px;
			border-radius: 2px;
			display: flex;
			align-items: center;
			cursor: pointer;
		}
		.public_Search_container{
			position: relative;
		}
		.public_Search_container input{
			width: 240px;
			height: 32px;
			border: 1px solid #d9d9d9;
		}
		.public_Search_container i{
			position: absolute;
			bottom: 6px;
			right: 10px;
			cursor: pointer;
		}
	</style>
</head>
<body>
	<!-- 顶部提示框 开始 -->
	<div class="public_tipSetting_contaienr">
		<div class="public_tipSetting_content">
			<p>当管理员给员工分配客户时，员工会在企业微信 「新建的提醒应用」 内收到消息提醒，进入详情页面可看到分配的客户电话信息。</p>
			<a href="https://support.qq.com/products/174823/faqs/81276" target="_blank">查看教程</a>
			<svg id="closeTips" t="1599462804099" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8813" width="15" height="15"><path d="M512 102.4a409.6 409.6 0 1 0 409.6 409.6 409.6 409.6 0 0 0-409.6-409.6z m181.248 518.144a51.2 51.2 0 0 1-72.704 72.704L512 584.192l-108.544 109.056a51.2 51.2 0 0 1-72.704-72.704L439.808 512 330.752 403.456a51.2 51.2 0 0 1 72.704-72.704L512 439.808l108.544-109.056a51.2 51.2 0 0 1 72.704 72.704L584.192 512z" fill="" p-id="8814"></path></svg>
		</div>
	</div>
	<!-- 顶部提示框 结束 -->
	<div class="public_container">
		<!-- /*公共头部带搜索*/ -->
		<div class="public_content">
			<div class="public_title_container">
				<p>批量加好友</p>
			</div>
			<div class="public_buttonSearch_container">
				<a>导入Excel</a>
				<!--<div class="public_Search_container">
					<input type="text" name="title" required  lay-verify="required" placeholder="输入Excel名称" autocomplete="off" class="layui-input">
					<i class="layui-icon layui-icon-search"></i>
				</div>-->
			</div>
		</div>
		<!-- /*公共头部带搜索*/ end -->
		<!-- 公共表格部分 -->
		<div class="public_table_container">
			<table class="layui-table" lay-skin="line">
			  <colgroup>
			      <col>
			      <col>
			      <col>
			    </colgroup>
			    <thead>
			      <tr>
			        <th>Excel名称</th>
			        <th>上传时间</th>
			        <th>分配员工</th>
			        <th>标签</th>
			        <th>总人数</th>
			        <th>已添加人数</th>
			        <th>操作</th>
			      </tr> 
			    </thead>
			    <tbody>
				{loop $res as $r}
					<tr>
			        <td>{$r->excel_name}</td>
			        <td>{date('y-m-d H:i:s',$r->ctime)}</td>
			        <td>
					{loop json_decode($r->users,1) as $user}
					   <div class="service-card">
                         <i class="iconfont icon-person"></i>{$h->get_user_by_id($r->wid,$user)['name']}
                      </div> 
				   {/loop}
					</td>
			        <td>
					{loop json_decode($r->select_label,1) as $tag}
					  {if $h->get_et_tags($r->wid)[$tag]}
					  <span class="table-public-label">{$h->get_et_tags($r->wid)[$tag]}</span>
					  {/if}
				   {/loop}
					</td>
			        <td>{$r->totalNumber}</td>
			        <td>{$r->addNumber}</td>
			        <td>
						<a href="javascript::void(0)" class="table-public-btn" onclick="remind({$r->id})">提醒</a>
			        	<a type="button" class="table-public-btn" onclick="del_mission({$r->id})">删除</a>
			        	<a href="mission_info-{$r->id}.html" class="table-public-btn" >详情</a>
			        </td>
			      </tr>
				{/loop}
			      <!--<tr>
			        <td>Excel批量添加好友模板.xlsx</td>
			        <td>2020-07-19 22:01</td>
			        <td>张鹏</td>
			        <td>标签1</td>
			        <td>100</td>
			        <td>0</td>
			        <td>
			        	<button type="button" class="layui-btn layui-btn-sm layui-btn-danger">删除</button>
			        	<a href="addFriendsDetail.html" class="layui-btn layui-btn-sm" >详情</a>
			        </td>
			      </tr>-->
			    </tbody>
			</table>
		</div>
		<!-- 公共表格部分 end-->
		<div class="main-container-h pageing-container-h">
		        <div class="pageing-content-h">
		           <span>{$p->totalnum}条/{$p->totalpage}页</span> 
		        </div>
				<ul class="pageing-content-h">
		           {P weidogsadmin}
				</ul>
	    </div>
	</div>
	
	<script src="/cdn/jquery.js"></script>
	<script src="/layui/layui.js"></script>
	<script src="/js/ajax.js"></script>
	<script type="text/javascript">
		$("#closeTips").click(function(){
			$('.public_tipSetting_contaienr').hide();
		})
	</script>
	<script type="text/javascript">
		// 弹窗
		layui.use('layer', function(){
		  var layer = layui.layer;
		}); 
	</script>
	<script type="text/javascript">
		$('.public_buttonSearch_container a').on('click',function(){
			layer.open({
			  type: 2,
			  title: '上传表格',
			  shadeClose: true,
			  shade: 0.2,
			  area: ['900px', '650px'],
			  content: 'import_excel.html'
			}); 
		})
		function del_mission(id){
			if(confirm('确定删除吗？')){
				myAjaxPost(false, true, 'del_mission.html', { id:id}, function (resp) {
						if (resp.status == 'success') {
							tusi(resp.msg);
							setTimeout(function(){
								location.href = 'mission_list.html';
							},500);
						}else{
							alert(resp.msg);
						}
					});
			}
		}
		
		function remind(id){
			if(confirm('确定提醒吗？')){
				myAjaxPost(false, true, 'remind.html', { id:id}, function (resp) {
						if (resp.status == 'success') {
							tusi(resp.msg);
						}else{
							alert(resp.msg);
						}
					});
			}
		}
	</script>
</body>
</html>